#include <REGX52.H>
#include "delay.h"
#include "LCD1602.h"
#include "XPT2046.h"

unsigned int adValue;

void main()
{
	LCD_Init();
	LCD_ShowString(1, 1, "ADJ  NTC  GR");
	while(1)
	{
		// 读取AIN0，电位器数值获取
		adValue = XPT2046_readAD(XPT2046_XP);
		LCD_ShowNum(2, 1, adValue, 3);
		
		// 读取AIN1，热敏电阻数值获取
		adValue = XPT2046_readAD(XPT2046_YP);
		LCD_ShowNum(2, 6, adValue, 3);
		
		// 读取AIN2，光敏电阻数值获取
		adValue = XPT2046_readAD(XPT2046_VBAT);
		LCD_ShowNum(2, 11, adValue, 3);
		delay(100);
	}
}
